package com.itmk.business.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itmk.business.article.entity.Article;
import com.itmk.vo.req.ArticleReqVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ArticleMapper extends BaseMapper<Article> {


    List<Article> getArticleListByCategoryId(@Param("categoryId") Long categoryid);
    Long saveArticle(@Param("article") Article article);
    Long updateArticle(@Param("article") Article article);
    Article getArticleById(@Param("id") Long id);
    IPage<Article> getArticleList(IPage<Article> iPage,@Param("articleReqVO")ArticleReqVO articleReqVO);
    @Update("update article set is_display=#{article.isDisplay} where id=#{article.id}")
    Long displayArticle(@Param("article") Article article);
}
